package com.spider.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//lombok技术可以实现为类自动添加无参构造器、getter、setter、toString方法等
@Data//@Data注解，为类添加getter、setter、toString方法等
@NoArgsConstructor
@AllArgsConstructor
public class Card {
    //卡片信息：车牌号码、车主姓名、电话号码、卡片余额
    private String number;//车牌号码
    private String name;//车主姓名
    private String phone;//电话号码
    private double balance;//卡片余额

    //预存金额
    public void saveMoney(double money){
        this.balance += money;
    }

    //消费金额
    public void payMoney(double money){
        this.balance -= money;
    }
}
